package webfinal.web;

import webfinal.common.framework.simplemvc.RequestMapping;
import webfinal.entity.Student;
import webfinal.service.StudentService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RequestMapping("/stu")
public class StudentController {
   StudentService studentService=new StudentService();
    @RequestMapping("/list.do")
    public String listStudent(HttpServletRequest request , HttpServletResponse response){
        List<Student> allStudents=studentService.findAllStudents();
       request.setAttribute("students",allStudents);
        return "/student/list";//视图
    }



}
